/****** Object:  Table [dbo].[Books]    Script Date: 07/17/2011 18:26:01 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[Books](
	[BookId] [int] IDENTITY(1,1) NOT NULL,
	[Title] [varchar](100) NOT NULL,
	[SeriesOrder] [int] NULL,
 CONSTRAINT [PK_Books] PRIMARY KEY CLUSTERED 
(
	[BookId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[BookInfos]    Script Date: 07/17/2011 18:26:30 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[BookInfos](
	[BookInfoId] [int] IDENTITY(1,1) NOT NULL,
	[BookId] [int] NOT NULL,
	[CoverLocation] [varchar](250) NOT NULL,
	[Synopsis] [varchar](2000)
	,
 CONSTRAINT [PK_BookInfos] PRIMARY KEY CLUSTERED 
(
	[BookInfoId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[BookInfos]  WITH CHECK ADD  CONSTRAINT [FK_BookInfos_Books] FOREIGN KEY([BookId])
REFERENCES [dbo].[Books] ([BookId])
GO

ALTER TABLE [dbo].[BookInfos] CHECK CONSTRAINT [FK_BookInfos_Books]
GO

--Insert into Books
insert into books (title, seriesorder) values('	Debt of Bones	',	1	)
insert into books (title, seriesorder) values('	Wizard''s First Rule	',	2	)
insert into books (title, seriesorder) values('	Stone of Tears	',	3	)
insert into books (title, seriesorder) values('	Blood of the Fold	',	4	)
insert into books (title, seriesorder) values('	Temple of the Winds	',	5	)
insert into books (title, seriesorder) values('	Soul of the Fire	',	6	)
insert into books (title, seriesorder) values('	Faith of the Fallen	',	7	)
insert into books (title, seriesorder) values('	The Pillars of Creation	',	8	)
insert into books (title, seriesorder) values('	Naked Empire	',	9	)
insert into books (title, seriesorder) values('	Chainfire	',	10	)
insert into books (title, seriesorder) values('	Phantom	',	11	)
insert into books (title, seriesorder) values('	Confessor	',	12	)
--Insert for BookInfos
insert into bookInfos(bookid, coverlocation) values(1, 'http://upload.wikimedia.org/wikipedia/en/0/0b/Debt_of_Bones.jpg')
insert into bookInfos(bookid, coverlocation) values(2, 'http://upload.wikimedia.org/wikipedia/en/7/7b/Wizard%27s_First_Rule.jpg')
insert into bookInfos(bookid, coverlocation) values(3, 'http://upload.wikimedia.org/wikipedia/en/0/00/Stone_of_Tears.jpg')
insert into bookInfos(bookid, coverlocation) values(4, 'http://upload.wikimedia.org/wikipedia/en/f/f4/Blood_of_the_Fold.jpg')
insert into bookInfos(bookid, coverlocation) values(5, 'http://upload.wikimedia.org/wikipedia/en/e/e9/Temple_of_the_Winds.jpg')
insert into bookInfos(bookid, coverlocation) values(6, 'http://en.wikipedia.org/wiki/File:Soul_of_the_Fire.jpg')
insert into bookInfos(bookid, coverlocation) values(7, 'http://upload.wikimedia.org/wikipedia/en/a/a1/Faith_of_the_Fallen.jpg')
insert into bookInfos(bookid, coverlocation) values(8, 'http://upload.wikimedia.org/wikipedia/en/6/60/The_Pillars_of_Creation.jpg')
insert into bookInfos(bookid, coverlocation) values(9, 'http://upload.wikimedia.org/wikipedia/en/a/a5/Naked_Empire.jpg')
insert into bookInfos(bookid, coverlocation) values(10, 'http://upload.wikimedia.org/wikipedia/en/5/59/Chainfire.jpg')
insert into bookInfos(bookid, coverlocation) values(11, 'http://upload.wikimedia.org/wikipedia/en/1/17/Phantom_SoT.jpg')
insert into bookInfos(bookid, coverlocation) values(12, 'http://upload.wikimedia.org/wikipedia/en/6/66/Confessor.jpg')
